// Imports
@import './theme.scss';

/**
* This css is executed before load the Angular application. It includes the
* loader of the main page.
*
* This code comes from the md-spinner of material2 repository. At this point,
* the app is not loaded so I can't use the component.
*/

// Github ribbon
.github-corner {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 99;

  svg {
    width: $header-bar-height;
    height: $header-bar-height;
  }
}

// Main loader
.main-loader {
  h1 {
    text-align: center;
    font-family: 'Ubuntu', Arial, sans-serif;
    font-size: 3em;
    margin: 1.5em 0 .5em;
  }

  .spinner {
    position: relative;
    margin: 0 auto;
    width: 60px;

    &:before {
      content: '';
      display: block;
      padding-top: 100%;
    }

    .circular {
      animation: rotate 2s linear infinite;
      height: 100%;
      transform-origin: center center;
      width: 100%;
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      right: 0;
      margin: auto;
    }

    .path {
      stroke-dasharray: 1, 200;
      stroke-dashoffset: 0;
      stroke: mat-color($monocular-app-primary);
      animation: dash 1.5s ease-in-out infinite;
    }
  }
}

// Animations
@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes dash {
  0% {
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 89, 200;
    stroke-dashoffset: -35px;
  }
  100% {
    stroke-dasharray: 89, 200;
    stroke-dashoffset: -124px;
  }
}
